#ifndef MPLAYER_H
#define MPLAYER_H

#include"mprocess.h"
//#include<qlabel.h>
#include <qwidget.h>
#include <QDebug>
#include <QFile>
#include <QTimer>
#include <QLabel>

#include"log.h"

#define MPLAYPATH "E:/project/Qt/slcd1.0/"
extern QString g_installPath;

class mplayer : public mprocess
{
    Q_OBJECT

    LOG4QT_DECLARE_QCLASS_LOGGER

public:
    explicit mplayer(QObject *parent = 0);
    ~mplayer();

    void restart(QString fileName);

//    void setwid(QWidget* pView=NULL);
    void setrect(QRect rect);
    bool play(QString fileName);
    void pause();
    void stop();
    void closePlay();                             //离开，关闭播放
    void getseek();
    void setseek(int secs);
    void getvolume();
    void setvolume();

    void hide();
    void show();

    void seekToTimePos(const float seconds);
    void getCurTimePos();

signals:
    void mplayfinished();

public slots:
    void processFinished(int exitCode, QProcess::ExitStatus exitStatus);

    void timeout();

private:
//    QWidget*  m_pView;
    QWidget*  m_pView;

    QRect     m_rect;
    QString   m_fileName;

    QTimer*   m_playTimer;
};

#endif // MPLAYER_H
